docs: add Phoenix collateral deposits and withdrawals - #255
Merged
Conversation
Solana.PerpetualCollateralMovements is newly deployed -- it was not in the schema when I introspected the Solana cubes earlier today. CollateralMovement .Type is Deposit or Withdraw, denominated in PhUsd, so this is the money-in and money-out view of Phoenix that nothing in the panel covered. Adds it as a query and as a stream, both under Perpetuals / Phoenix. The query as originally written returned 892 unbounded rows in no defined order. The saved version takes 25 newest-first and carries Block.Time and the transaction signature, so a reader can see when each movement happened and follow it on chain. Trader, Signer, Amount, Currency and Fee are unchanged. Both were executed before saving and re-executed from the stored text afterwards: 25 rows for the query, and the subscription delivers on connect. Also fixes the injection helper. It placed authored entries into whichever tab it was pointed at, so pointing it at a file containing both a query and a subscription put each of them in the wrong tab as well as the right one. It now matches the entry kind to the tab, which is what caught this before it shipped. 734 query entries across 32 groups, 413 stream entries across 17. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solana.PerpetualCollateralMovementsis newly deployed — it was not in the schema when I introspected the Solana cubes earlier today.CollateralMovement.TypeisDepositorWithdraw, denominated inPhUsd, so this is the money-in / money-out view of Phoenix that nothing in the panel covered.Added as both a query and a stream, under Perpetuals / Phoenix.
What changed from the query as supplied
The original returned 892 rows, unbounded and in no defined order. The saved version:
limit: {count: 25}withorderBy: {descending: Block_Time}— newest first, boundedBlock.TimeandTransaction.Signature, so a reader can see when each movement happened and follow it on chainTrader,Signer,Amount,Currency,Fee,TypeunchangedThe comment header shows how to filter one side (
Type: {is: "Withdraw"}) or follow one account, and notes the obvious uses: net-flow dashboards, whale withdrawal alerts, and reconciling a trader's realised PnL against what they actually took off the venue.Verification
Both were executed before saving and re-executed from the stored text afterwards — 25 rows for the query, and the subscription delivers on connect.
Values confirmed against live data rather than assumed: over a 400-row sample,
TypeisDeposit(267) andWithdraw(133), currencyPhUsdthroughout.A bug this caught
The injection helper placed authored entries into whichever tab it was pointed at. Pointing it at a file containing both a query and a subscription put each of them in the wrong tab as well as the right one — the audit failed with the subscription sitting in the Queries tab, where it has no HTTP verdict.
The helper now matches entry kind to tab. Worth having: it means a mixed authored file can no longer land a stream in the query list.
State
734 query entries across 32 groups, 413 stream entries across 17.
All eleven gates pass, 0 non-ASCII comments across 1,142 queries, widest comment line 78 characters, production build clean.
🤖 Generated with Claude Code